package Singleton;

public class Singleton {
	private static Singleton s;
	//定义一个私有的构造函数
	private Singleton(){
		
	}
	
	public static Singleton getSingleton() {
		if (s == null) {  
	        synchronized (Singleton.class) {  
	        if (s == null) {  
	            s = new Singleton();  
	        }  
	        }  
	}
		return s;
}

	public void haha() {
		System.err.println("test+++++++");
	}
}
